![]() METHOD FOR DETERMINING THE DATABASE STATUS AND DEVICE FOR DETERMINING THE DATABASE STATUS
专利摘要:
the present application discloses a method for determining the state of the database, to alleviate an existing technology problem, that a relatively large amount of computing resources is consumed when a database state value is determined. the method includes: determining a state transition operation performed on a target database; and determining, based on the given state transition operation and a state value that is from the target database and that exists before the state transition operation is performed, a state value that is from the target database and which exists after the state transition operation is performed, where the state value is used to represent a state of the target database. the present application further discloses a device for determining the status of the database and a method and device for checking the consistency of the database. 公开号:BR112019014478A2 申请号:R112019014478-1 申请日:2018-05-23 公开日:2020-05-26 发明作者:Zhao Boran 申请人:Alibaba Group Holding Limited; IPC主号:
专利说明:
“METHOD FOR DETERMINING THE DATABASE STATUS AND DEVICE FOR DETERMINING THE DATABASE STATUS” Field of invention [001] The present application concerns the field of computer technologies and, in particular, the method and device for determining the status of the database and a method and device for checking the consistency of the database. Background of the Invention [002] When storing data, a computer sometimes stores the same data in a plurality of different databases. The data stored in these different databases in general need to be synchronized based on a service requirement, that is, the data stored in the databases in general need to be consistent. Trusted protocol technology is used as an example. After the verification is performed, a plurality of transaction records are written to all nodes (databases that correspond to the nodes) that store trust protocol data. To ensure that a new block accepted by all nodes is generated, the data stored in all databases that correspond to all nodes must be consistent. For another example, in the case of a primary / secondary database in distributed storage, to help restore data from another database (the secondary database) when an error occurs in the data in the main database, the stored data in the primary database and the data stored in the secondary database in general must also be consistent. [003] To ensure that data stored in a plurality of databases are consistent, verification of Petition 870190065828, of 12/07/2019, p. 83/117 2/30 consistency can be performed on the data in the plurality of databases, and corrective action can be taken in a timely manner when the data is inconsistent. Since the database in general includes a lot of data, checking the consistency of the database in general is performed by comparing a state value used to represent a state of data in the database, instead of comparing all the data in the database. plurality of databases one by one. To facilitate description, the state of the data in the database can be called the state of the database. [004] In the existing technology, after the data in a database changes each time, a status value of the database needs to be redetermined. When the status value is determined, the status value is generally calculated using all data in the database. For example, the status value can be a hash value of the data in the database. In this case, when the hash value is determined, all data in the database needs to be joined (joined) to obtain a string (string). Then, the string is used as the input to a hash function and the hash value is calculated using the hash function. In that case, when the database includes a relatively large amount of data, a relatively large amount of computing resources is consumed when the status value of the database is determined. Brief Description of the Invention [005] Embodiments of the present invention provide a method for determining the state of the database, to alleviate an existing technology problem, in which a relatively large amount of bond resources is consumed when a state value is determined of the database. [006] The following technical solutions are used in the embodiments of this application. Petition 870190065828, of 12/07/2019, p. 84/117 3/30 [007] A method for determining the state of the database is provided, including: determining a state transition operation performed on a target database; and determining, based on the given state transition operation and a state value that is from the target database and that exists before the state transition operation is performed, a state value that is from the target database and which exists after the state transition operation is performed, where the state value is used to represent a state of the target database. [008] The embodiments of the present invention also provide a device for determining the state of the database, to alleviate an existing technology problem, in which a relatively large amount of bonding resources is consumed when a value of database status. [009] A device for determining the state of the database is provided, including: a first unit of determination, configured to determine a state transition operation performed on a target database; and a second unit of determination, configured to determine, based on the determined state transition operation and a state value that is from the target database and that exists before the state transition operation is performed, a state value which is from the target database and which exists after the state transition operation is performed, where the state value is used to represent a state of the target database. [010] A method for checking database consistency is provided, including: determining whether a state value of a first database to be verified and a state value of a second database to be checked are those themselves, where the state value of the first Petition 870190065828, of 12/07/2019, p. 85/117 The database and the status value of the second database are determined using the method for determining the status of the database provided in the present application; and if the state value of the first database and the state value of the second database are the same, determining that a state of the first database and a state of the second database are consistent. [011] A device for checking the consistency of the database is provided, including: a state determination unit, configured to determine whether a state value of a first database to be verified and a state value of a second database to be verified are the same, in which the status value of the first database and the status value of the second database are determined, using the device for determining the status of the database provided in the present request; and a consistency determination unit, configured for: when it is determined that the state value of the first database and the state value of the second database are the same, determine that a state of the first database and a state second database are consistent. [012] At least one of the previous technical solutions used in the embodiments of the present application can achieve the following beneficial effects. [013] When the state value of the database whose data is changed due to the state transition operation is determined, the state transition operation performed on the target database is determined and then the state value of the database and which exists after the state transition operation is performed is determined based on the determined state transition operation and the state value that is in the database and which exists before the transition operation Petition 870190065828, of 12/07/2019, p. 86/117 5/30 state to be executed. Compared to existing technology, there is no need to perform an operation on all data in the entire database, thereby reducing excessive consumption of computing resources. Brief Description of the Figures [014] The accompanying drawings described herein are intended to provide an additional understanding of this application and form a part of this application. The illustrative embodiments of the present application and descriptions of the embodiments are intended to describe the present application and are not limitations in the present application. In the attached drawings: Figure 1 is a schematic diagram illustrating a data structure of a hash tree, in accordance with the present application; Figure 2 is a flowchart of schematic embodiment illustrating a method for determining the state of the database, according to the present invention; Figure 3 is a flowchart of schematic embodiment illustrating a method for checking the consistency of the database, according to the present invention; Figure 4 is a flowchart of schematic embodiment illustrating a method for determining the state of the database, according to the present invention; Figure 5 is a schematic diagram illustrating a specific structure of a device for determining the state of the database, according to the present invention; and Figure 6 is a schematic diagram that illustrates a specific device structure for checking the consistency of the Petition 870190065828, of 12/07/2019, p. 87/117 6/30 database, according to the present invention. Detailed Description of the Invention [015] To clarify the objectives, technical solutions and advantages of this application, the following describes clearly and completely the technical solutions of this application with reference to specific embodiments and accompanying drawings that correspond to this application. Apparently, the described embodiments are just a few and not all embodiments of the present application. All other embodiments obtained by a person skilled in the art based on the embodiments of this application without creative efforts must fall within the scope of protection of this application. [016] The technical solutions provided in the embodiments of this application are described in detail below with reference to the attached drawings. [017] As computing technologies develop, it is increasingly common to verify that data across all databases are consistent. A trust protocol is used as an example. The trust protocol is a distributed database, a change of each part of the data in the trust protocol is transmitted to each trust protocol node in the entire network, and all nodes must have complete and consistent data. The data is generally stored in a plurality of data units on each node. A data unit can be a block in the trust protocol, or it can be a data unit that includes a plurality of blocks. When a node state value is determined, a hash tree like a Merkle tree is constructed using a data hash value in each data unit as a leaf node and then a hash value from a root node of the hash tree is used as the state value of the database, so the value Petition 870190065828, of 12/07/2019, p. 88/117 7/30 status is used to uniquely represent a state of the database. [018] Figure 1 is a schematic diagram illustrating a data structure of a hash tree built for a given database. When a hash value for a root node of the hash tree is calculated, a data hash value in each data unit is calculated first. Then, the obtained hash value is used as a hash value of a leaf node of the hash tree and a hash value of a parent node of each leaf node is calculated, so that the hash value of the root node of the tree hash is finally obtained. After the data in the database has been changed, a database status value will need to be determined again. As such, the previous process of calculating the hash value of the root node of the hash tree needs to be repeated. If there is a large amount of data in the database, a hash operation will need to be performed on a large amount of data. This consumes a lot of computing resources. [019] In some similar scenarios, when the database state value is determined, a relatively large amount of computing resources is also consumed. Details are omitted here for simplicity. To alleviate the problem, the present application provides a method for determining the state of the database, so that a state of a target database is determined based on a state transition operation performed on the target database. . [020] The text below describes in detail the method for determining the status of the database provided in this application. The method can be performed by a computing device, for example, a database node in a distributed database or a node in a trusted protocol. In addition, the method can be performed by a Petition 870190065828, of 12/07/2019, p. 89/117 8/30 application program that implements the method for determining the state of the database provided in this application. To facilitate description, an embodiment of the method is described below using an example that the method is performed by a computing device. It can be understood that, the method is performed by a computing device is only an example for description, and should not be considered as a limitation in the method. [021] Figure 2 is a flowchart of schematic embodiment that illustrates a method for determining the state of the database, according to the present invention. The method includes the steps below. [022] Step (S101): Determine a state transition operation performed on a target database. [023] The state transition operation here can be a database operation that causes a state change in a database and can be specifically an operation such as a data recording operation, a data update operation data or a data delete operation. The state transition operation can include merged data and a method for processing the data. For example, the data recording operation includes data to be recorded and a specific location to which the data needs to be recorded in the database. The target database here can be a database on which the state transition operation is performed and the target database can be any database whose status value is to be determined. [024] In real applications, there may be many methods for determining the state transition operation. For example, in an object-oriented application program, if the state transition operation is implemented by an object, the state transition operation can be determined by determining a data operation object that Petition 870190065828, of 12/07/2019, p. 90/117 9/30 corresponds to the state transition operation; or the state transition operation can be determined based on a database operation statement that corresponds to the state transition operation. The data operation object here is a data object that is in an object-oriented application program and is used to perform a database operation. In the object-oriented application program, an “object” in general is an instance whose class is loaded into memory and has member variables and related member functions. [025] How a state transition operation causes a data change in a database, after the state transition operation is determined, a state of the database and which exists after the state transition operation is performed can be determined. [026] Step (S102): Determine, based on the determined state transition operation and a state value that is from the target database and that exists before the state transition operation is performed, a state value that it is from the target database and exists after the state transition operation is performed. [027] The state value here is used to represent a state of the target database. Since the status value can be used to perform consistency checking on the target database, the status value can be used to exclusively represent a characteristic of the data stored in the target database. For example, the state value can be a hash value or it can be a globally unique identifier. The hash value is obtained by performing a hash operation on an input parameter using a hash function. The globally unique identifier can be an identifier allocated by a system and used to uniquely identify a state of the database in the system. [028] It is worth noting that a technician on the subject must be Petition 870190065828, of 12/07/2019, p. 91/117 10/30 aware that “representing exclusively” should not be interpreted as absolute exclusivity, but it does mean exclusivity within a permitted error range. Currently, for the most widely used hash algorithm, theoretically, different input data has the same output hash value, that is, there is a hash collision. [029] An existing state after the data in a database is related to an existing state before the data change and a state transition operation. Thus, after the determination of the state transition operation is performed on the target database, the state value that is from the target database and which exists after the state transition operation can be determined based on the state transition determined and the state value that is from the target database and that exists before the operation is performed. [030] In real applications, as described in step (S101), in the object-oriented application program, the state transition operation can be determined by determining the data operation object that corresponds to the state transition operation. Subsequently, the state value which is from the target database and which exists after the state transition operation is performed can be determined based on the determined data operation object and the state value which is from the destination and before the state transition operation performed. [031] To help distinguish between different state transition operations using a short identifier, the state transition operation can also be represented exclusively using a given characteristic value. The characteristic value of the state transition operation can be a hash value or it can be a globally unique identifier used to uniquely identify the state transition operation. Details are omitted here for simplicity. To help calculate the Petition 870190065828, of 12/07/2019, p. 92/117 11/30 characteristic value of the state transition operation and the state value that is from the target database to obtain the state value that is from the target database and that exists after the state transition operation is performed , a data format of the characteristic value can be the same or similar to a data format of the state value that is from the target database. [032] In real applications, for the object-oriented application program, a hash value of the data operation object can be determined and then the state value that is from the target database and that exists after the state transition operation is performed, it is determined based on the determined hash value of the data operation object and the state value that is from the target database and that exists before the state transition operation is performed. [033] The text below specifically describes a process for determining the hash value of the data operation object in this embodiment of the present request. [034] When the hash value of the data operation object is determined, to convert a data format of the data operation object into a format supported by the input of a hash algorithm, a serialization operation can be performed on the object data operation. The serialization operation can convert object state information into a format that can be stored or transmitted. After the serialization operation is performed on the data operation object, the serialized data that corresponds to the data operation object can be obtained. For example, a data format for serialized data can be a binary format and data in binary format can be used as input to the hashing algorithm. [035] After the serialized data corresponding to the Petition 870190065828, of 12/07/2019, p. 93/117 12/30 data operation object is obtained, a hash operation can be performed on the serialized data to obtain a hash value from the serialized data, and the hash value from the serialized data can be used as the hash value of the serialized data data operation. [036] It is worth noting that, a single state transition operation generally corresponds to more than one data operation object, for example, each state transition operation performed by a node in a trust protocol in a way general corresponds to a plurality of data operation objects. As such, when the data operation object that corresponds to the state transition operation is serialized, all data operation objects can be serialized separately; then, all the serialized data obtained are joined sequentially; and finally, the merged serialized data obtained is used as serialized data that correspond to the state transition operation. [037] When all the serialized data obtained is joined sequentially, if a sequence of execution of the state transition operation by all data operation objects is fixed, the serialized data corresponding to all data operation objects are joined based on the sequence of execution of the state transition operation, to obtain the merged serialized data. Alternatively, if a sequence of execution of the state transition operation for all data operation objects is not fixed, the serialized data corresponding to all data operation objects are joined based on a first pre-sequence. determined, to get the serialized data joined. Then, a hash value of the merged serialized data can be calculated using a hash function and the hash value of the merged serialized data is used as the hash value of the merged operation object. Petition 870190065828, of 12/07/2019, p. 94/117 13/30 data that corresponds to the state transition operation. [038] The first predetermined sequence can be a predetermined joining sequence. For example, if a data format in each data operation object is a key-value format, the serialized data that corresponds to all data operation objects can be joined in decreasing order of key-values. [039] After the hash value of the data operation object that corresponds to the state transition operation is determined, the state value that is from the target database and that exists after the state transition operation can be determined based on the determined hash value of the object data operation and the state value that is from the target database and that exists before the state transition operation is performed. Specifically, the hash value of the data operation object and the state value that is from the target database and that exists before the state transition operation is performed can be joined based on a second pre-sequence determined to obtain merged data. A hash value of the merged data is determined. The hash value of the merged data is used as the state value that is from the target database and that exists after the state transition operation is performed. [040] The first predetermined sequence and the second predetermined sequence here, each, can be a predetermined joining sequence. When the state values of all databases are calculated, the same join sequence must be used when the data is joined. Otherwise, even if the data in all databases are consistent, the calculated status values will be different and the consistency between the databases cannot be verified accurately. [041] It is worth noting that, in some cases, two different groups of data possibly become the same data joined after the Petition 870190065828, of 12/07/2019, p. 95/117 14/30 execution of the union. For example, “hello” and “world” data can be joined to obtain the joined data ’’ helloworld ”, and likewise, the“ he ”and“ Howorld ”data are joined to obtain“ helloworld ”. Apparently, the two groups of data are different data before the join is performed. In this case, to prevent different data from becoming the same data after the join is performed, when a join operation is performed, a separator can be used to guarantee the uniqueness of the joined data. Specifically, a predetermined separator can be placed in a data union location. The predetermined tab can be predefined by a developer. For example, the separator is 123. In this case, the data “hello” and “world” can be joined to obtain “hello123world” and the data “he” and “Howorld” can be joined to obtain “he123lloworld”. As such, it can be ensured that two pieces of data are different data after the union is performed. [042] Based on the previous method for joining data using a separator, when the serialized data corresponding to all data operation objects are joined, a predetermined separator can be placed between at least two pieces of serialized data that will be joined and all parts of the serialized data obtained after placing the predetermined separator are joined, to obtain the joined serialized data. Certainly, before the data is joined using a separator, if different groups of data are the same data after the execution of the join can be determined first. When a determination result is that the merged data is the same, each group of data is merged using the separator to obtain merged serialized data. [043] According to the method for determining the state of the database provided in this embodiment of the present application, when the state value of the database whose data changes are determined, the state transition operation performed in data base Petition 870190065828, of 12/07/2019, p. 96/117 Destination 15/30 is determined and then the state value of the database and which exists after the state transition operation is performed can be determined based on the determined state transition operation and the state value that is from the database and exists before the state transition operation is performed. Compared to existing technology, there is no need to perform an operation on all data in the entire database, thereby reducing excessive consumption of computing resources. In addition, compared to a hash value of a node it is calculated using a tree structure as a hash tree in the existing trust protocol technology, in this embodiment of the present application, a tree structure does not need to be constructed, and a hash value for each node in the tree structure does not need to be calculated, thus reducing the consumption of checking the consistency of excessive computing resources. [044] In some preferred solutions provided in this embodiment of the present application, a serialization operation is performed on a data operation object and a hash operation is performed on serialized data, and this consumes a certain amount of computing resources . However, in a distributed database, particularly in a trusted protocol, the database in general stores a very large amount of data, and the computing resources consumed by performing a hash operation on the database data. data is much more than the computing resources consumed by the previous operation in this embodiment of the present application. [045] According to the previous method of determining the status of the database, a status value of a database can be determined. Subsequently, the consistency check can be performed on the database based on the determined status value. The text below Petition 870190065828, of 12/07/2019, p. 97/117 16/30 describes in detail a method for checking the consistency of the database provided in the present application. [046] Figure 3 is a flowchart of schematic embodiment that illustrates the method for checking the consistency of the database. The method includes the steps below. [047] Step (S201): Determine if a status value of a first database to be checked and a status value of a second database to be checked are the same. [048] The first database and the second database here are databases to be verified. In this case, the status value of the first database and the status value of the second database can be determined separately based on the method for determining the status of the database provided in this embodiment of the present application. For a specific determination process, references can be made to related descriptions in this application. Details are omitted here for simplicity. [049] Step (S202): If the state value of the first database and the state value of the second database are the same, determine that a state of the first database and a state of the second database are consistent. [050] If the state value of the first database and the state value of the second database are different, it will be determined that the state of the first database and the state of the second database are inconsistent. [051] Based on the previous inventive concept in this application, to help better understand the technical resources, means and effects of this application, the text below uses an example that a target database is used as a database of a node in a technology of Petition 870190065828, of 12/07/2019, p. 98/117 17/30 confidence protocol to further describe the method for determining the status of the database in this application. [052] In this embodiment of the present application, an example that a trust protocol application is a mesh trust protocol application, a target database is a LevelDB database and a base state value data is a hash value used for description. A state transition operation can be performed on the LevelDB database using a data operation object. The data transaction object can write data in a key-value format to the LevelDB database. When the state transition operation is performed on a trusted protocol, a consensus algorithm is used to ensure that the state transition operations are consistent across all nodes and that the state transition is performed in the same order. [053] For each trust protocol node, when no data is recorded in a database, an initial state S init of each database is empty. In that case, a hash value can be provided. Here, the hash value of the initial state of the database is denoted as H init . [054] In this case, when it is determined that an i s state transition operation - Transition 'is performed on the target database, a hash value from the target database can be recalculated based on the operation. Figure 4 is a schematic flow diagram of the process and the process includes the steps below. [055] Step (S301): Determine a data operation object that corresponds to the state transition operation. [056] A single state transition operation generally corresponds to a plurality of data operation objects, and the state transition operation i for the node can be denoted as a set {op1, op2 ... opN} , where p is the abbreviation for “operation”, indicates a single object Petition 870190065828, of 12/07/2019, p. 99/117 18/30 data operation and means a write operation for a single key-value pair. One format for each op is Key: = NewVal. Like tai, {op1, op2 ... opN} indicates write operations for N key-value pairs during the state transition operation i. [057] Step (S302): Serialize each data operation object in serialized data in a binary format. [058] Step (S303): Determine whether a sequence of execution of the state transition operation for all data operation objects is fixed; and if so, perform step (S304); or if not, perform step (S305). [059] Step (S304): If the sequence of execution of the state transition operation for all data operation objects is fixed, merge, based on the sequence of execution of the state transition operation, the serialized data corresponding to all data operation objects, to obtain serialized data joined; and perform the step (S306). [060] Step (S305): If the sequence of execution of the state transition operation for all data operation objects is not fixed, join, based on a first predetermined sequence, the serialized data corresponding to all the data operation objects, to get serialized data joined. [061] The first predetermined sequence here can be a decreasing order of key values. [062] Step (S306): Determine a hash value from the merged serialized data and use the hash value as a hash value that corresponds to the state transition operation. [063] The merged serialized data is used as input for the hashing algorithm to perform a hash operation, in order to obtain the hash value of the merged serialized data, that is, a hash value - Hash Petition 870190065828, of 12/07/2019, p. 100/117 19/30 (Transition ') of the Transition' state transition operation. [064] Step (S307): Join, based on a second predetermined sequence, the hash value that corresponds to the state transition operation and a hash value H ' 1 that is from the target database and that it exists before the state transition operation is performed to get merged data. [065] Step (S308): Determine a hash value of the merged data and use the hash value of the merged data as a hash value H 'which is from the target database and which exists after the state transition operation Transition 'to be performed. [066] The hash value finally obtained H 'which is from the target database and which exists after the Transition state transition operation is performed, can be represented by the following equation: H': = Hash (H M | | Hash (Transition ')). [067] H ° = H init , where | indicates a join operation, Hash (x) is a hash function and indicates that a hash operation is performed on the input data x, and the hash function can be, for example, SHA3. [068] According to the method for determining the state of the database provided in this embodiment of the present application, when the hash value of the database whose data is changed, the Transition state transition operation performed in target database is determined; then, the hash value - Hash (Transition) that corresponds to the state transition operation is determined; and the state value H 'which is from the database and which exists after the state transition operation is performed can be determined based on the hash value H' 1 which is from the database and which exists before the operation state transition to be performed. Compared to existing technology, there is no need to perform an operation on all data in the database Petition 870190065828, of 12/07/2019, p. 101/117 20/30 of the entire node to obtain a hash value, thereby reducing excessive consumption of computing resources. In addition, compared to a hash value of a node it is calculated using a tree structure as a hash tree in the existing trust protocol technology, in this embodiment of the present application, a tree structure does not need to be constructed, and a hash value for each node in the tree structure does not need to be calculated, so the consumption of computing resources is further reduced. [069] The method for determining the state of the database provided in the embodiments of the present invention is described above. As shown in Figure 5, based on the same idea, an embodiment of the present invention further provides a device for determining the state of the corresponding database. The device specifically includes: a first determination unit (401), configured to determine a state transition operation performed on a target database; and a second determination unit (402), configured to determine, based on the determined state transition operation and a state value that is from the target database and that exists before the state transition operation is performed, a state value that is from the target database and exists after the state transition operation is performed, where the state value is used to represent a state from the target database. [070] In this embodiment of the present invention, there are still many specific embodiments of determining a state of the database. In one embodiment, the first determination unit (401) is configured to determine a data operation object, used to perform the state transition operation on the target database. Petition 870190065828, of 12/07/2019, p. 102/117 21/30 [071] The second unit of determination (402) is configured to determine, based on the determined data operation object and the state value that is in the target database and that exists before the state transition operation is performed , the state value that is from the target database and that exists after the state transition operation is performed. [072] In one embodiment, the second determination unit (402) specifically includes a first hash value that determines the subunit (403) and a first state value determination subunit (404). [073] The first hash value determination subunit (403) is configured to determine a hash value of the data operation object. [074] The first state determination subunit (404) is configured to determine, based on the determined hash value of the data operation object and the state value that is in the target database and that exists before the operation state transition is performed, the state value that is from the target database and that exists after the state transition operation is performed. [075] In one embodiment, the first hash value determination subunit (403) specifically includes a serialized data determination subunit (405) and a second hash value determination subunit (406). [076] The serialized data determination subunit (405) is configured to serialize the data operation object to obtain serialized data. [077] The second hash value determination subunit (406) is configured to: determine a hash value from serialized data Petition 870190065828, of 12/07/2019, p. 103/117 22/30 and use the hash value of the serialized data as the hash value of the data operation object. [078] In one embodiment, the subunit (405) for determining serialized data specifically includes a first splicing subunit (407) and a second splicing subunit (408). [079] In one embodiment, the first join subunit (407) is configured for: when there is more than one data operation object used to perform the state transition operation in the target database and a sequence of execution of the state transition operation for all data operation objects, merge, based on the sequence of execution of the state transition operation, serialized data corresponding to all data operation objects, to obtain serialized data United. [080] The second join subunit (408) is configured for: when there is more than one data operation object used to perform the state transition operation in the target database, and a sequence of execution of the transition operation status for all data operation objects is not fixed, merge, based on a first predetermined sequence, serialized data that corresponds to all data operation objects, to obtain united serialized data. [081] To prevent different groups of data from being the same data after the execution of the join, in one embodiment, the second join subunit (408) is configured to: place a predetermined separator between at least two parts of serialized data and merge all parts of serialized data obtained after the predetermined separator is placed, to obtain the serialized data joined. [082] In one embodiment, the subunit (404) of determining the first state is configured to: join, based on a Petition 870190065828, of 12/07/2019, p. 104/117 Second predetermined sequence, the hash value of the data operation object and the state value that is from the target database and that exists before the state transition operation is performed to obtain merged data; and determining a hash value of the merged data and using the hash value of the merged data as the state value that is from the target database and that exists after the state transition operation is performed. [083] In one embodiment, the target database is a database that corresponds to any node in a trusted protocol. [084] In one embodiment, the status value is used to exclusively represent a characteristic of the data stored in the destination database. [085] According to the device for determining the status of the database provided in this embodiment of the present application, when the status value of the database whose data changes are determined, the state transition operation performed in target database is determined, in which the state transition operation is a state transition operation that causes the data to change. Then, the state value which is from the database and which exists after the state transition operation is performed is determined based on the determined state transition operation and the database state value and which exists before the state transition operation. Compared to existing technology, there is no need to perform an operation on all data in the entire database, thereby reducing excessive consumption of computing resources. [086] An embodiment of the present invention further provides a device for checking the consistency of the corresponding database. As shown in Figure 6, the device includes Petition 870190065828, of 12/07/2019, p. 105/117 Specific 24/30: a unit of determination (501), configured to determine whether a state value of a first database to be verified and a state value of a second database to be verified are the same, where the state value of the first database and the state value of the second database are determined, using the device provided in the previous embodiment of the present application; and a consistency determination unit (502), configured for: when it is determined that the state value of the first database and the state value of the second database are the same, determine that a state of the first database and a state of the second database is consistent. [087] It is worth noting that, in the 1990s, if a technical improvement is a hardware improvement (for example, an improvement to a circuit structure like a diode, a transistor or a switch) or a software improvement (a improvement to a procedure of the method) can be clearly distinguished. However, as technologies develop, current improvements in many method procedures can be seen as direct improvements in hardware circuit structures. A designer generally programs an improved method procedure on a hardware circuit to obtain a corresponding hardware circuit structure. Therefore, a method procedure can be improved using a hardware entity module. For example, a programmable logic device (PLD) (for example, an FPGA (Field Programmable Gate Array)) is an integrated circuit, and a logic function of the PLD is determined by a user through device programming. The designer performs the programming to “integrate” a digital system with a PLD without asking a chip manufacturer to design and produce an application-specific integrated circuit chip. Furthermore, today, instead of manufacturing Petition 870190065828, of 12/07/2019, p. 106/117 25/30 manually an integrated circuit chip, this programming is implemented mainly using the software “logical compiler”. Logical compiler software is similar to a software compiler used to develop and write a program. The original code must be written in a specific programming language for compilation. The language is referred to as a hardware description language (HDL). There are many HDLs, such as the Advanced Boolean Expression Language (ABEL), the Altera Hardware Description Language (AHDL), Confluence, the Cornell University Programming Language (CUPL), HDCal, the Java Hardware Description Language (JHDL) ), Lava, Lola, MyHDL, PALASM and the Ruby hardware description language (RHDL). The very high speed integrated circuit hardware (VHDL) description language and Verilog are the most used. A person skilled in the art should also understand that a hardware circuit that implements a logical method procedure can be readily obtained since the method procedure is logically programmed using the various hardware description languages described and is programmed in an integrated circuit. [088] A controller can be implemented using any appropriate method. For example, the controller can be a microprocessor or processor or a computer-readable medium that stores computer-readable program code (such as software or firmware) that can be run by the microprocessor or processor, a logic port, a switch, a application-specific integrated circuit (ASIC), a programmable logic controller or a built-in microprocessor. Examples of the controller include, but are not limited to, the following microprocessors: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320. The memory controller can also be implemented as part of the memory control logic. A technician in Petition 870190065828, of 12/07/2019, p. 107/117 The subject also knows that, in addition to implementing the controller using computer-readable program code, logical programming can be performed in the method steps to allow the controller to implement the same function in shapes of the logical port, switch, application-specific integrated circuit, programmable logic controller and built-in microcontroller. Therefore, the controller can be considered as a hardware component, and a device configured to implement various functions in the controller can also be considered as a structure in the hardware component. Or the device configured to implement various functions can even be considered as a software module that implements the method and a structure in the hardware component. [089] The system, device, module or unit illustrated in the previous embodiments can be implemented using a computer chip or an entity, or can be implemented using a product having a certain function. A typical embodiment device is a computer. The computer can be, for example, a personal computer, a portable computer, a cell phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an e-mail device, a game console, a tablet computer, or a wearable device, or a combination of any of those devices. [090] To facilitate description, the device above is described by dividing functions into several units. Certainly, when the present invention is implemented, a function of each unit can be implemented in one or more pieces of software and / or hardware. [091] A person skilled in the art should understand that the embodiment of the present invention can be provided as a method, system or computer program product. Therefore, the present Petition 870190065828, of 12/07/2019, p. 108/117 The application may use a hardware-only embodiment, software-only embodiments or embodiments with a combination of software and hardware. In addition, the present invention may use a form of computer program product that is implemented on one or more storage media usable per computer (including, but not limited to, disk memory, CD-ROM, optical memory, etc.) that include program code usable by the computer. [092] The present invention is described with reference to the flowcharts and / or block diagrams of the method, the device (system) and the computer program product based on the embodiments of the present invention. It is worth noting that computer program instructions can be used to implement each process and / or each block in flowcharts and / or block diagrams and a combination of a process and / or a block in flowcharts and / or diagrams of blocks. These computer program instructions can be provided for a general purpose computer, a dedicated computer, an embedded processor or a processor from another programmable data processing device to generate a machine, so that instructions executed by another computer or processor programmable data processing device generates a device to implement a specific function in one or more processes in flowcharts and / or in one or more blocks in block diagrams. [093] These computer program instructions can be stored in a computer-readable memory that can instruct the computer or other programmable data processing device to function in a specific way, so that the instructions stored in the computer generated memory generate an artifact that includes an instructional device. The instruction device implements a function Petition 870190065828, of 12/07/2019, p. 11/117 28/30 specific in one or more processes in flowcharts and / or in one or more blocks in block diagrams. [094] These computer program instructions can be loaded on the computer or on another programmable data processing device, so that a series of operations, operations and steps are performed on the computer or on another programmable device, thus generating processing implemented by the computer. Therefore, instructions executed on the computer or on another programmable device provide steps to implement a specific function in one or more processes in flowcharts and / or in one or more blocks in block diagrams. [095] In a typical configuration, a calculation device includes one or more processors (CPU), an input / output interface, a network interface and a memory. [096] Memory may include non-persistent memory, random access memory (RAM), non-volatile memory and / or otherwise in a computer-readable medium, for example, a read-only memory (ROM) or a flash memory (RAM flash). Memory is an example of a computer-readable medium. Memory is an example of a computer-readable medium. [097] The computer-readable medium includes persistent, non-persistent, mobile and immobile media that stores information storage using any method or technology. The information can be a computer-readable instruction, a data structure, a program module or other data. Examples of a computer storage medium include, but are not limited to, a phase change memory (PRAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), another type of access memory (RAM), a read-only memory (ROM), a read-only memory Petition 870190065828, of 12/07/2019, p. 110/117 Programmable and electrically erasable 29/30 (EEPROM), a flash memory or other memory technology, a compact disc (CD-ROM) reading memory, a digital versatile disc (DVD) or other storage, a magnetic tape cassette, a magnetic tape / magnetic disk storage or other magnetic storage device. The computer's storage medium can be used to store information accessible by the calculation device. Based on the definition of this specification, the computer-readable medium does not include transient means (transient means), for example, a modulated and carrier data signal. [098] It is also worth noting that the terms "include", "including" or any other variant are intended to cover a non-exclusive inclusion, therefore, a process, a method, a product or a device that includes a list of elements not only they include these elements, but it also includes other elements that are not expressly listed, or it also includes elements inherent in such a process, method, product or device. An element preceded by "includes a ..." does not exclude, without further restrictions, the existence of additional identical elements in the process, method, product or device that includes the element. [099] The present invention can be described in the general context of computer executable instructions executed by a computer, for example, a program module. In general, the program module includes a routine, a program, an object, a component, a data structure, etc., performing a specific task or implementing a specific abstract data type. The present application can also be practiced in distributed computing environments. In distributed computing environments, tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, the program module can be located either Petition 870190065828, of 12/07/2019, p. 111/117 30/30 on the local and remote computer's storage media, including storage devices. [0100] The embodiments in the present specification are described in a progressive manner. For equal or similar parts of the embodiments, references can be made to the embodiments. Each embodiment focuses on a difference from other embodiments. In particular, an embodiment of the system is basically similar to the embodiment of a method and is therefore briefly described. For related parties, references can be made to related descriptions in the embodiment of the method. [0101] The previous embodiments are only embodiments of this application and are not intended to limit this application. A person skilled in the art can make several modifications and changes to this application. Any modification, equivalent substitution, or improvement made without departing from the spirit and principle of this order, will fall within the scope of the claims in this order.
权利要求:
Claims (14) [1] 1. METHOD FOR DETERMINING THE DATABASE STATUS, characterized by the fact that the method comprises: determining a state transition operation performed on a data operation object of a target database; and determine, based on the state transition operation and a pre-state value that is from the target database and that exists before the state transition operation is performed, a state value that is from the destination database destination and which exists after the state transition operation is performed, where the state value is used to represent a state of the target database. [2] 2. METHOD, according to claim 1, characterized by the fact that the object of data operation comprises: an instance whose class is loaded into memory of the target database and has member variables and related member functions. [3] 3. METHOD, according to claim 2, characterized by the fact that the determination of the state value that is from the target database and that exists after the state transition operation is performed comprises: determine, based on the data operation object and the state value which is in the target database and which exists before the state transition operation is performed, the state value which is in the target database and which exists after the state transition operation is performed. [4] 4. METHOD, according to claim 3, characterized by the fact that the target database is a reliable protocol database. Petition 870190065828, of 12/07/2019, p. 113/117 2/4 [5] 5. METHOD, according to claim 4, characterized by the fact that the determination of the state value that is from the target database and that exists after the state transition operation is performed comprises: determine a hash value of the data operation object; and determine, based on the hash value of the data operation object and the state value that is in the target database and that exists before the state transition operation is performed, the state value that is in the database destination data and that exists after the state transition operation is performed. [6] 6. METHOD, according to claim 5, characterized by the fact that the determination of a hash value of the data operation object comprises: serialize the data operation object to obtain serialized data; and determining a hash value of the serialized data and using the hash value of the serialized data as the hash value of the data operation object. [7] 7. METHOD, according to claim 6, characterized by the fact that the serialization of the data operation object to obtain the serialized data comprises: determine whether a sequence of execution of the state transition operation for all data operation objects is fixed; and if the sequence of execution of the state transition operation for all data operation objects is fixed, fixed, splicing, based on the sequence of execution of the state transition operation, the serialized data corresponding to all data operation objects, to get serialized data joined. Petition 870190065828, of 12/07/2019, p. 114/117 3/4 [8] 8. METHOD, according to claim 6, characterized by the fact that the serialization of the data operation object to obtain the serialized data comprises: determine whether a sequence of execution of the state transition operation for all data operation objects is fixed; and if the sequence of execution of the state transition operation for all data operation objects is not fixed, merge, based on a first predetermined sequence, the serialized data corresponding to all data operation objects, to get serialized data merged. [9] 9. METHOD, according to claim 7, characterized by the fact that obtaining the serialized data together comprises: placing a predetermined separator between at least two parts of the serialized data and joining all parts of the serialized data obtained after the predetermined separator is placed, to obtain the serialized data joined. [10] 10. METHOD, according to claim 5, characterized by the fact that the determination of the state value that is from the target database and that exists after the state transition operation is performed comprises: join, based on a second predetermined sequence, the hash value of the data operation object and the state value that is from the target database and that exists before the state transition operation is performed, to obtain joined data; and determining a hash value of the merged data and using the hash value of the merged data as the state value that is from the target database and that exists after the state transition operation is performed. Petition 870190065828, of 12/07/2019, p. 115/117 4/4 [11] 11. METHOD, according to any of the claims 1 to 7, characterized by the fact that the target database is a database that corresponds to any node in a trusted protocol. [12] 12. METHOD, according to claim 1, characterized by the fact that the state value is used to exclusively represent a characteristic of data stored in the target database. [13] 13. METHOD, according to claim 1, characterized by the fact that it also comprises: determining whether the pre-state value of the target database to be verified is the same as the state value; and in response to the determination that the pre-state value is the same as the state value of the target database, determining that the pre-state and state of the target database are consistent. [14] 14. DEVICE FOR DETERMINING THE DATABASE STATUS, characterized by the fact that the device comprises a plurality of modules, configured to execute the method, as defined in any of claims 1 to 13.
类似技术:
公开号 | 公开日 | 专利标题 BR112019014478A2|2020-05-26|METHOD FOR DETERMINING THE DATABASE STATUS AND DEVICE FOR DETERMINING THE DATABASE STATUS BR112019014589A2|2020-02-18|SERVICE AND APPLIANCE PROCESSING METHOD BR112019020374B1|2022-01-25|Method, non-transient computer-readable storage media and system for blockchain consensus BR112019013441A2|2019-12-31|data storage method and data storage device BR112019013204A2|2019-12-10|service processing method and service processing device BR112019013412B1|2022-02-01|Method for processing data based on a reliable protocol, computer-readable medium, and computer-implemented system. JP6804668B2|2020-12-23|Block data validation method and equipment JP6675518B1|2020-04-01|Method and device for processing a service request BR112019013394A2|2020-03-03|DATA PROCESSING METHOD AND DATA PROCESSING DEVICE TWI731233B|2021-06-21|Method, circuit and computer readable medium for calibrating component WO2020211493A1|2020-10-22|Data verification method, system, apparatus and device in block chain account book BR112019009576A2|2019-10-22|data processing method and device TWI714017B|2020-12-21|Data processing method, device and server TWI514279B|2015-12-21|Server system and firmware update method TWI662486B|2019-06-11|Method and device for checking completeness of distributed business processing BR112019010368B1|2021-12-14|METHOD FOR PROCESSING A SERVICE REQUEST AND DEVICE FOR PROCESSING A SERVICE REQUEST BR112019009591B1|2021-11-23|COMPUTER IMPLEMENTED METHOD FOR PERFORMING DISPLAY SWITCHING IN A TRUST PROTOCOL NETWORK, COMPUTER-READABLE, NON- TRANSIENT, AND COMPUTER IMPLEMENTED SYSTEM BR112020019925A2|2021-01-05|SERVICE API INVOCATION METHOD AND RELATED DEVICE BR112019019871A2|2020-04-22|consensus verification method and apparatus BR112019009591A2|2019-12-17|trust protocol consensus method and trust protocol consensus device
同族专利:
公开号 | 公开日 PH12019501637A1|2020-03-16| CN107247749B|2020-08-25| US20200057760A1|2020-02-20| MX2019008383A|2019-09-11| KR102231058B1|2021-03-25| CA3049831A1|2018-11-29| JP2020509451A|2020-03-26| WO2018214897A1|2018-11-29| TWI710916B|2020-11-21| RU2725760C1|2020-07-06| TW201901484A|2019-01-01| KR20190096391A|2019-08-19| CA3049831C|2021-12-14| CN107247749A|2017-10-13| US10789243B2|2020-09-29| JP6921206B2|2021-08-18| EP3557452A1|2019-10-23| AU2018274424B2|2020-07-02| AU2018274424A1|2019-08-01| SG11201906495TA|2019-08-27| EP3557452A4|2020-01-22| EP3557452B1|2021-09-15|
引用文献:
公开号 | 申请日 | 公开日 | 申请人 | 专利标题 JPH03152992A|1989-10-27|1991-06-28|W R Grace & Co|Printed circuit board and its manufacture| CN1054886A|1990-03-19|1991-10-02|湖南省森林植物园|A kind of production technology of solid carbonic acid drink| US9824107B2|2006-10-25|2017-11-21|Entit Software Llc|Tracking changing state data to assist in computer network security| CN101957858A|2010-09-27|2011-01-26|中兴通讯股份有限公司|Data comparison method and device| CN102354292A|2011-09-21|2012-02-15|国家计算机网络与信息安全管理中心|Method and system for checking consistency of records in master and backup databases| CN102662946B|2012-02-20|2015-10-07|北京地拓科技发展有限公司|The method and system of change is recorded in a kind of automatic monitoring data storehouse| US9697238B2|2012-03-01|2017-07-04|Microsoft Technology Licensing, Llc|Drift detection and notification| US9032247B2|2012-07-26|2015-05-12|Apple Inc.|Intermediate database management layer| JP2014059757A|2012-09-18|2014-04-03|International Business Maschines Corporation|Device and method for processing data having tree structure and program| CN103164523A|2013-03-19|2013-06-19|华为技术有限公司|Inspection method, device and system of data consistency inspection| CN103345521B|2013-07-17|2016-04-13|腾讯科技(深圳)有限公司|A kind of method and apparatus processing key assignments in Hash table database| CN103678583B|2013-12-11|2017-07-21|北京华胜天成科技股份有限公司|The method and system that structural data compares| CN104731792B|2013-12-19|2018-09-21|中国银联股份有限公司|The method and system of data base consistency method of calibration and system, location database difference| CN105447046A|2014-09-02|2016-03-30|阿里巴巴集团控股有限公司|Distributed system data consistency processing method, device and system| CN104346454B|2014-10-30|2017-12-05|上海新炬网络技术有限公司|Data consistency verification method based on oracle database| US9436923B1|2015-02-26|2016-09-06|Skuchain, Inc.|Tracking unitization occurring in a supply chain| EP3278287A4|2015-03-31|2018-08-22|Nasdaq, Inc.|Systems and methods of blockchain transaction recordation| CN106484690A|2015-08-24|2017-03-08|阿里巴巴集团控股有限公司|A kind of verification method of Data Migration and device| US9390154B1|2015-08-28|2016-07-12|Swirlds, Inc.|Methods and apparatus for a distributed database within a network| JP6452156B2|2015-09-03|2019-01-16|日本電信電話株式会社|License information management system, user terminal, rights holder terminal, license information management method, and license information management program| US20170116693A1|2015-10-27|2017-04-27|Verimatrix, Inc.|Systems and Methods for Decentralizing Commerce and Rights Management for Digital Assets Using a Blockchain Rights Ledger| CN105488675B|2015-11-25|2019-12-24|布比(北京)网络技术有限公司|Block chain distributed shared general ledger construction method| CN105976232B|2016-06-24|2020-04-28|深圳前海微众银行股份有限公司|Asset transaction method and device| CN106250721A|2016-07-28|2016-12-21|杭州云象网络技术有限公司|A kind of electronic copyright protection method based on block chain| CN106230808A|2016-07-28|2016-12-14|杭州云象网络技术有限公司|A kind of personal credit information system method based on block chain technology| CN106357405A|2016-09-19|2017-01-25|弗洛格(武汉)信息科技有限公司|Method and system for managing data on basis of block chain technology consistency algorithms| CN107247749B|2017-05-25|2020-08-25|创新先进技术有限公司|Database state determination method, consistency verification method and device|CN107247749B|2017-05-25|2020-08-25|创新先进技术有限公司|Database state determination method, consistency verification method and device| CN107807982B|2017-10-27|2020-09-18|中国农业银行股份有限公司|Consistency checking method and device for heterogeneous database| CN107729541A|2017-10-31|2018-02-23|咪咕数字传媒有限公司|A kind of data processing method, device and computer-readable recording medium| US11146407B2|2018-04-17|2021-10-12|Digicert, Inc.|Digital certificate validation using untrusted data| CN108615156A|2018-05-09|2018-10-02|上海魅联信息技术有限公司|A kind of data structure based on block chain| CN109345159A|2018-08-21|2019-02-15|深圳市口袋网络科技有限公司|A kind of method for writing data and device, equipment, storage medium| CN109446211B|2018-10-08|2020-08-14|联动优势科技有限公司|Consistency checking method and device| TWI710238B|2018-12-17|2020-11-11|財團法人國家實驗研究院|Synchronous deletion method of distributed storage system| US11044096B2|2019-02-04|2021-06-22|Accenture Global Solutions Limited|Blockchain based digital identity generation and verification| US11122091B2|2019-04-16|2021-09-14|FireMon, LLC|Network security and management system| CN110175758A|2019-05-08|2019-08-27|杭州宇链科技有限公司|Multilayer is shared in the benefit method automatically on a kind of chain based on block chain| WO2019179538A2|2019-07-11|2019-09-26|Alibaba Group Holding Limited|Shared blockchain data storage| EP3669280B1|2019-07-11|2021-09-08|Advanced New Technologies Co., Ltd.|Shared blockchain data storage| WO2019179540A2|2019-07-11|2019-09-26|Alibaba Group Holding Limited|Shared blockchain data storage|
法律状态:
2021-04-06| B25A| Requested transfer of rights approved|Owner name: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD. (KY) | 2021-04-27| B25A| Requested transfer of rights approved|Owner name: ADVANCED NEW TECHNOLOGIES CO., LTD. (KY) | 2021-10-19| B350| Update of information on the portal [chapter 15.35 patent gazette]|
优先权:
[返回顶部]
申请号 | 申请日 | 专利标题 CN201710377721.8|2017-05-25| CN201710377721.8A|CN107247749B|2017-05-25|2017-05-25|Database state determination method, consistency verification method and device| PCT/CN2018/087966|WO2018214897A1|2017-05-25|2018-05-23|Database state determining method and device, and consistency verifying method and device| 相关专利
Sulfonates, polymers, resist compositions and patterning process
Washing machine
Washing machine
Device for fixture finishing and tension adjusting of membrane
Structure for Equipping Band in a Plane Cathode Ray Tube
Process for preparation of 7 alpha-carboxyl 9, 11-epoxy steroids and intermediates useful therein an
国家/地区
|